Skip to content

chore(ci): add lockfile-lint PR check for yarn.lock injection prevention#7114

Merged
jstirnaman merged 2 commits intorelease/2026-04-20from
worktree-chore-security-npmrc-cooldown
Apr 20, 2026
Merged

chore(ci): add lockfile-lint PR check for yarn.lock injection prevention#7114
jstirnaman merged 2 commits intorelease/2026-04-20from
worktree-chore-security-npmrc-cooldown

Conversation

@jstirnaman
Copy link
Copy Markdown
Contributor

Summary

Add a GitHub Actions workflow that validates yarn.lock on every PR, preventing lockfile injection attacks.

What it does

Runs lockfile-lint (v5.0.0, via npx) to verify that every resolved URL in yarn.lock:

  • Uses HTTPS (rejects http://, git://, or bare URLs)
  • Points to registry.yarnpkg.com (rejects unknown/attacker-controlled hosts)

Why this matters

Lockfile injection is a supply-chain attack where a PR modifies yarn.lock to redirect package resolution to attacker-controlled hosts. The change is easy to miss in code review because lockfiles are large and auto-generated. This check catches it automatically.

Reference: Lockfile injection research (Liran Tal, 2019)

Workflow design

  • Trigger: PRs modifying yarn.lock
  • Sparse checkout: Only fetches yarn.lock (not the full repo)
  • SHA-pinned actions: actions/checkout@v6.0.2, actions/setup-node@v6.3.0
  • Least privilege: permissions: contents: read, persist-credentials: false
  • Zero new dependencies: Uses npx --yes lockfile-lint@5.0.0 (not added to package.json)

Baseline verified

All 802 resolved entries in yarn.lock currently point to https://registry.yarnpkg.com/ — no false positives expected.

Test plan

  • actionlint passes on the new workflow
  • lockfile-lint reports "No issues detected" on current yarn.lock
  • Simulated injection (http://evil.example.com) correctly detected and exits non-zero
  • PR check appears and passes when this PR is reviewed

Add a GitHub Actions workflow that validates yarn.lock on every PR,
ensuring all resolved URLs use HTTPS and point to registry.yarnpkg.com.
Prevents lockfile injection attacks where a PR modifies resolved URLs
to fetch packages from attacker-controlled hosts.

Uses lockfile-lint@5.0.0 via npx (no new dependencies in package.json).
SHA-pinned actions, sparse checkout of yarn.lock only, least-privilege
permissions.
@jstirnaman jstirnaman requested a review from a team as a code owner April 17, 2026 01:52
@jstirnaman jstirnaman requested review from sanderson and removed request for a team April 17, 2026 01:52
@jstirnaman jstirnaman changed the base branch from master to release/2026-04-20 April 20, 2026 20:40
@jstirnaman jstirnaman merged commit 1021be1 into release/2026-04-20 Apr 20, 2026
5 checks passed
jstirnaman added a commit that referenced this pull request Apr 20, 2026
* Telegraf v1.38.3 (#7126)

* Updating changelog

* Updating plugin list

* Updating product version

* Updating plugins

---------

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* chore(ci): add lockfile-lint PR check to prevent yarn.lock injection (#7114)

Add a GitHub Actions workflow that validates yarn.lock on every PR,
ensuring all resolved URLs use HTTPS and point to registry.yarnpkg.com.
Prevents lockfile injection attacks where a PR modifies resolved URLs
to fetch packages from attacker-controlled hosts.

Uses lockfile-lint@5.0.0 via npx (no new dependencies in package.json).
SHA-pinned actions, sparse checkout of yarn.lock only, least-privilege
permissions.

* chore(deps): bump dompurify from 3.3.3 to 3.4.0 (#7109)

Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.3.3 to 3.4.0.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.3.3...3.4.0)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release Chronograf v1.11.1 (#7105)

* Release Chronograf v1.11.1

* Update content/chronograf/v1/about_the_project/release-notes.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/chronograf/v1/about_the_project/release-notes.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/chronograf/v1/about_the_project/release-notes.md

---------

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
Co-authored-by: Daniel Campbell <metalwhirlwind@gmail.com>

* feat(products): add oss_repo field for products with public repos (#7106)

Adds `oss_repo` to data/products.yml for products that have a public
GitHub repository. Each entry captures the repo name and the product's
default branch. Presence of the field indicates the product has a public
repo; absence indicates it does not (e.g., v3 Enterprise, Cloud
Dedicated, Cloud Serverless, Clustered, Enterprise v1).

This separates repo identity from `namespace`, which currently conflates
URL path / menu grouping with GitHub repo name. Templates can derive
issue, source, or release URLs from `oss_repo.name` + `oss_repo.branch`
without hardcoded product fixups.

For multi-version products (influxdb OSS v1/v2), `branch` uses a
version-keyed map consistent with other versioned fields like
`content_path` and `latest_patches`.

Groundwork for #7095 feedback-button routing redesign.

Co-authored-by: Claude <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
Co-authored-by: Daniel Campbell <metalwhirlwind@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant